<!-- toaster directive -->
<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->

<!-- 导航条 -->
<div class="bg-white bread-crumb">
	<ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
		<li><a ui-sref="main"><i class="glyphicon glyphicon-log-in"></i> 门禁管理</a></li>
		<li><a ui-sref="main.authm.cardAuth.list" class="active" ng-bind="title"></a></li>
	</ul>
</div>

<!-- 加载提醒 -->
<div ng-show="loading" class="text-center m-t-md text-lg dataWarn"><i class="fa fa-spin fa-spinner"></i> 数据加载中...</div>

<!-- 内容区域 -->
<div ng-hide="loading" class="wrapper-md content">
    <!-- 数据显示 -->
    <div class="wrapper-data">
        <div class="panel panel-default">
            <!-- 头部 -->
            <div class="panel-heading clearfix">
<!--                 <a ui-sref="main.authm.cardAuth.create" class="btn btn-info pull-right"> -->
<!--                     <i class="icon-user-follow m-r-sm text-md"></i>添加授权</a> -->
                <div class="w-auto">
                    <form ng-submit="search()" class="form-inline">
							<div class="form-group">
								<label for="personName">姓名：</label>
								<input type="text"class="form-control" style="width: 180px"placeholder="" ng-model="param.personName"id="personName">
							</div>
							<div class="form-group">
								<label for="authNo">卡号：</label>
								<input type="text"class="form-control" style="width: 180px"placeholder="" ng-model="param.authNo"id="authNo">
							</div>
							<div class="form-group">
								<label for="authType">卡类型：</label>
								<select class="form-control" style="width: 180px" ng-model="param.authType" id="authType">
									<option value="">全部</option>
									<option value="0">身份证</option>
									<option value="4">居住证</option>
									<option value="5">IC卡</option>
								</select>
							</div>
							<div class="form-group">
								<button  type="submit" class="btn btn-primary new-primary"style="margin-left: 10px" ng-show="read">查询</button>
								<!--<button ui-sref="main.authm.cardAuth.quickAuth" type="submit" class="btn btn-primary new-primary"-->
										<!--style="margin-left: 10px" ng-show="add">快捷人员授权-->
                                <!--</button>-->
                                <button ui-sref="main.authm.cardAuth.create" type="button" class="btn btn-primary addNew"
                                        style="margin-left: 10px" ng-show="add">
									<i class="glyphicon glyphicon-plus"></i>新增</button>
								<button ng-click="delAll()" type="button" class="btn btn-primary delAll"
                                        style="margin-left: 10px" ng-show="dele">
								<i class="glyphicon"></i>批量删除</button>
							</div>
           			 </form>
                </div>
            </div>

            <!-- 数据表格 -->
            <div class="table-responsive">
                <table class="table table-striped b-t b-light text-center">
                    <thead>
                    <tr>
                        <th><input name="allCheck" type="checkbox" value="" id="allCheck" ng-click="allCheck($event,data)"/>全选</th>
                    	<th>房屋地址</th>
                    	<th>姓名</th>
                    	<th>卡号</th>
                    	<th>有效期</th>
                    	<th>卡类型</th>
                    	<th>授权类型</th>
						<th>授权操作员</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody class="tbody">
                    <tr ng-repeat="item in pageInfo.data">
                        <td class="v-middle"><input name="Fruit" type="checkbox" id="{{item.id}}" value="{{item.id}}" ng-click="checkStatus()" /></td>
                        <td class="v-middle">{{item.locationName}}</td>
                        <td class="v-middle">{{item.personName}}</td>
                        <td class="v-middle">{{item.authNo}}</td>
						<td class="v-middle">{{item.endTime}}</td>
                        <td class="v-middle">
                        	<span ng-show="item.authType=='0'">身份证</span>
							<span ng-show="item.authType=='4'">居住证</span>
							<span ng-show="item.authType=='5'">IC卡</span>
                        </td>
                        <td class="v-middle">
                        	<span ng-show="item.authorType=='0'">卡授权</span>
                        	<span ng-show="item.authorType=='1'">app授权</span>
                        	<span ng-show="item.authorType=='2'">授权码授权</span>
                        </td>
						<td class="v-middle">{{item.userName}}</td>
                        
                        <td class="v-middle">
                        	<a href="#" ui-sref="main.authm.cardAuth.update({'id':item.id,'authorType':item.authorType})" ng-show="update">编辑</a>
                        	<a ng-click="openDelAuth(item.id)" ng-show="dele" style="padding:2px 3px;border:solid 1px;color:#fb7009;border-radius:4px;background: none;">销卡</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div><!-- /.table-responsive -->

            <!-- 底部分页 -->
			<span data-ng-include=" 'src/tpl/pageInfo.html' "></span>
        </div><!-- /.panel -->
    </div><!-- /.wrapper-data -->

</div><!-- /.wrapper-md -->

<script type="text/ng-template" id="delAuth.html" >  
     <div class="modal-header">
		<h4 class="modal-title">销卡提醒</h4>
	 </div>
	 <div class="modal-body">
		 是否一起删除用户该设备下所有授权？
			<div>
				<input type="checkbox"
				   style="width:20px;height:20px;margin: 126px auto;position: absolute;top: -112px;left: 545px;" }
				   ng-value=true ng-model="isDelAll" name="selectState"/>
			</div>

	 </div>
	 <div class="modal-footer">
		<button class="btn btn-primary new-primary" type="button" ng-click="delAuth()">确认</button>
		<button class="btn btn-warning addNew" ng-click="cancel()">取消</button>
	 </div>
</script>
<style scoped>
.delAll {
    line-height: 35.5px;
    padding: 0 10px;
    background-color: #FF0000;
    border-radius: 4px;
    color: #FF0000;
    border: none;
    vertical-align: middle;
    margin-left: 12px;
}

</style>